﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xss.Data.Common;
using System.Collections;

namespace Xss.Data.Common
{
    /// <summary>
    /// 数据源定义
    /// </summary>
    public interface IDbSource
    {
        /// <summary>
        /// 数据源编号
        /// </summary>
        string Name { get; set; }
        /// <summary>
        /// 数据连接字符串
        /// </summary>
        string ConnectionString { get; set; }
        /// <summary>
        /// 连接超时
        /// </summary>
        int Timeout { get; set; }
        /// <summary>
        /// 重置连接
        /// </summary>
        string ResetConnectionString(IDictionary setting);
        /// <summary>
        /// 数据连接提供
        /// </summary>
        string DbProvider { get; set; }
    }

    public class DbSource : IDbSource
    {
        public string Name
        {
            get;
            set;
        }

        public string ConnectionString
        {
            get;
            set;
        }

        public int Timeout
        {
            get;
            set;
        }

        public string ResetConnectionString(IDictionary setting)
        {
            return ConnectionString;
        }

        public string DbProvider
        {
            get;
            set;
        }
    }

}
